* {
    margin: 0;
    padding: 0;
}

:root,
body {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #444, #000, #000);
    overflow: hidden;
}

.wrapper {
    width: 500px;
    height: 500px;
    /* border: 1px solid #fff; */
    perspective: 1000px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes move {
    form {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(360deg);
    }
}

.cubic {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-50deg) rotateY(-50deg) rotateZ(0deg);
    animation: move 8s infinite cubic-bezier(0.45,-0.36, 0.52, 0.96);

}

.cubic>div {
    width: 100%;
    height: 100%;
    color: rgb(238, 138, 138);
    line-height: 200px;
    text-align: center;
    font-size: 100px;
    font-weight: bolder;
    position: absolute;
    backface-visibility: hidden;
    left: 0;
    top: 0;
    transition: transform 3s ease-in;
    background-color: rgba(51, 51, 51, .3);
    /* box-sizing: border-box; */
    /* transform-origin: 0 0; */
}

.cubic .font {
    transform: translateZ(100px);
}

.cubic .back {
    transform: translateZ(-100px) rotateY(180deg);
}

.cubic .left {
    transform: translateX(-100PX) rotateY(-90deg);
}

.cubic .right {
    transform: translateX(100px) rotateY(90deg)
}

.cubic .top {
    transform: translateY(-100px) rotateX(90deg)
}

.cubic .bottom {
    transform: translateY(100px) rotateX(-90deg)
}